<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::any('test', function () {
    return response()
        ->json([
            'all' => request()->all(),
            'get' => $_GET,
            'post' => $_POST,
        ]);
});

Route::group([
    'prefix' => 'hospital'
], function () {
    Route::get('/info', 'HospitalInfoController@info');
    Route::get('/banners', 'HospitalInfoController@banners');
    Route::get('/doctors', 'HospitalInfoController@doctors');
    Route::post('/form', 'HospitalInfoController@form');

    Route::get('/article', 'ArticleController@indexList');
    Route::any('/article/detail', 'ArticleController@detail');

});

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
